function loadSucAdminList(){
	$("#adminPageForm").find("input[name='areaId']").combobox({
		panelHeight:145,
		data:getAllAreaJson()
	});
	var toolbar = [{
	       			text:'添加',iconCls:'icon-add',
	       			handler:function(){addAdmin();}
	       		},{
	       			text:'修改',iconCls:'icon-edit',
	       			handler:function(){editAdmin();}
	            },{
	       			text:'删除',iconCls:'icon-remove',
	       			handler:function(){removeAdmin();}
	            }];
	$("#adminList").datagrid({
		fit:true,
		striped: true,//设置为true将交替显示行背景
		border:false, 
	    fitColumns: true,
	    toolbar:toolbar,
	    loadMsg: "正在加载中。。。",
	    columns: [[
	               { field: 'name', title: '登录名', width: 120,align:'center' },
	               { field: 'areaId', title: '管理员', width: 120,align:'center',
	            	   formatter:function(data){
	            	      if(data==0) return '超级管理员';
	            	      else return '区管理员';
	               } },
	               { field: 'areaName', title: '办案单位', width: 120,align:'center',
	            	   formatter:function(data,row,index){return areaNameFormatter(row.areaId);} }
	           ]],
	           rownumbers: false, //行号    
	           singleSelect: true, //是否单选
	           pagination: true,//分页控件
	           pageSize:20,
	           onLoadSuccess:onLoadSuccess
	});
	queryAdmin(1,20);
	$(".panel-tool").hide();
}
//重置后查询所有
function queryAdminAll(){
	$("#adminPageForm").form("clear");
	queryAdmin(1,20);
}
//查询申请管理列表
function queryAdmin(pageNum,pageSize){
	var url = 'LoadAdmin';
	var form = $("#adminPageForm"); 
	var param = form.serialize();
	param += "&pageNum="+pageNum+"&pageSize="+pageSize;
	loadDataGirdJson(url,param,'#adminList');
}
//添加管理员
function addAdmin(){
	openEditAdmin("修改管理员窗口");
}
//修改管理员
function editAdmin(){
	var row = $("#adminList").datagrid("getSelected");
	if(row==null){
		alert("请选择要修改的行!");return false;
	}
	openEditAdmin("修改管理员窗口",row);
}
//打开窗口
function openEditAdmin(title,row){
	var reqParm = {
    	    "callback": function(a){
    	          loadGridData(1,20);
             },
             row:row
    };
    var diyColumnWindow = {
    		id: 'editAdminWindow',
    		width: 400,
    		height: 300,
    		title: title,
    		url: 'editAdmin.jsp',
    		collapsible: false,
    		minimizable: false,
    		maximizable: false,
    		resizable: false,
    		closable: false,
    		param: reqParm
    };
    OpenNewWindow(diyColumnWindow);
}

//删除
function removeAdmin(){
	var target = $("#adminList");
	var row = $("#adminList").datagrid("getSelected");
	if(row==null){
		alert("请选择要删除的行!");return false;
	}
	$.post("DeleteAdminInfo", {name:row.name}, function(text) {
		var data = (new Function("return "+text))();
		if(data.status=='删除成功'){
			var index = target.datagrid("getRowIndex",row);
			target.datagrid("deleteRow",index);
		}
		alert(data.status);
	});
}